home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- * Copyright © 1992-1993 Mark Pilgrim *
- * *
- * This file is provided as is, and may be freely distributed unaltered. This *
- * message must accompany any copy of this file. This file may be used or *
- * modified for use for a non-commercial product provided that appropriate *
- * credit is given to the author named above. *
- * Commercial use of this source code is prohibited. *
- ******************************************************************************/
-
- #include "msg misc.h"
- #include "msg timing.h"
-
- #define BoxSize 10
- #define CorrectTime 3
-
- void FullScrollUD(GrafPtr);
-
- /* Take the full screen minus the bottom strip, move it into the whole screen
- shifted down by BoxSize, then take the bottommost source strip and put it
- in the top strip of the dest. window. */
-
- void FullScrollUD(GrafPtr sourceGrafPtr)
- {
- int x, y;
- Rect theRect, dest;
- Rect scrollsource, scrolldest;
-
- scrollsource=gMainWindow->portRect;
- scrollsource.bottom-=BoxSize; /* whole screen minus bottom strip */
- scrolldest = scrollsource;
- OffsetRect(&scrolldest, 0, BoxSize); /* whole screen shifted down BoxSize */
-
- dest = gMainWindow->portRect;
- dest.bottom=BoxSize; /* top strip for new data */
-
- theRect.top=MAIN_WINDOW_HEIGHT-BoxSize; /* bottom strip of source window */
- theRect.bottom=MAIN_WINDOW_HEIGHT;
- theRect.left=0;
- theRect.right=MAIN_WINDOW_WIDTH;
-
- for(x = MAIN_WINDOW_HEIGHT - BoxSize; x >= 0; x -= BoxSize)
- {
- StartTiming();
- CopyBits(&(gMainWindow->portBits), &(gMainWindow->portBits),
- &scrollsource, &scrolldest, 0, 0L);
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &theRect, &dest, 0, 0L);
- theRect.bottom-=BoxSize;
- theRect.top-=BoxSize;
- TimeCorrection(CorrectTime);
- }
- }